home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4949 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: esb.bbn.com!user
  2. From: rshapiro@bbn.com (R Shapiro)
  3. Newsgroups: comp.sys.mac.programmer.codewarrior,comp.lang.c++
  4. Subject: Re: templatized pointers to member functions (in CW8)
  5. Date: Thu, 01 Feb 1996 15:30:49 -0500
  6. Organization: BBN
  7. Message-ID: <rshapiro-0102961530500001@esb.bbn.com>
  8. References: <rshapiro-0102960833080001@ipa.bbn.com> <4er2af$nna@newsroom.hitc.com>
  9. NNTP-Posting-Host: esb.bbn.com
  10.  
  11. In article <4er2af$nna@newsroom.hitc.com>, psand@eos.hitc.com (G. Patrick
  12. Sand) wrote:
  13.  
  14. >>template <class OBJECT>
  15. >>class Test {
  16. >>   // (a) This is what I want but it won't compile in CodeWarrior 8:
  17. >>   //typedef void (OBJECT::*ObjectMemberFunction)(void); 
  18. >>
  19. >>   // (b) This works but isn't what I want:
  20. >>   typedef void (ATest::*ObjectMemberFunction)(void); 
  21. >>   
  22. >[snip!]
  23. >>};     
  24. >
  25. >I think the answer is NO.  A template is a cookie cutter for whatever you 
  26. >specify, but it doesn't assume any knowledge about what you specify 
  27. >beyond whether it is a class template or a function template.
  28.  
  29.  
  30. I'm not asking it to. I just want it to substitute the real class name for
  31. OBJECT in:
  32.  
  33.   typedef void (OBJECT::*ObjectMemberFunction)(void);
  34.  
  35. just as it does with all other references to OBJECT within the template.
  36.  
  37.  
  38. VisualC++ 4.0 does this successfully, by the way.
  39.  
  40. -- 
  41. rs/rshapiro@bbn.com
  42.